<?php
namespace Modules\Uploads;

use Phalcon\DiInterface;

class Module implements \Phalcon\Mvc\ModuleDefinitionInterface {
    public function registerAutoloaders(DiInterface $di = null) {
        (new \Phalcon\Loader()) -> registerNamespaces([
            __NAMESPACE__ . '\\Controllers' => __DIR__.DS.'controllers'.DS,
        ]) -> register();
    }


    public function registerServices(DiInterface $di) {
		$di -> set('dispatcher', function() {
			$dispatcher = new \Phalcon\Mvc\Dispatcher();
			$dispatcher -> setDefaultNamespace(__NAMESPACE__ . '\\Controllers');
			return $dispatcher;
		});

        $di -> set('view', function () {
			return (new \Phalcon\Mvc\View()) -> disable();
        });
    }
}